/*
 * @author Sawyer(870756077@qq.com)
 */

/**
 * 给每个组件取名字时，需注意其规则：
 * 例：一级菜单对应路由名称 name
 *    二级菜单对应路由名称 name/secondary-name
 *    三级菜单对应路由名称 name/secondary-name/three-name
 *    如不按照此规则面包屑导航将会失效
 * 如果不需要在左侧显示的路由 增加属性 noSidebarMenu: true
 */

/**
  * 获取组件路径
  *
  * @param {String} 组件路径
  */
function loaddingComponent(path) {
    return () => import(`@/admin/pages/${path}.vue`)
}

let menu = [
    {
        /**
         * 导航名称
         *
         * @type {String}
         */
        title: '概况',
        /**
         * 路由名称
         *
         * @type {String}
         */
        name: 'home',
        /**
         * 路由路径
         *
         * @type {String}
         */
        path: '/',
        /**
         * 组件路径
         */
        component: loaddingComponent('Home'),
        /**
         * 导航图标
         *
         * @type {String}
         */
        icon: ''
    },
    {
        title: '商品',
        name: 'goods',
        icon: '',
        /**
         * 二级导航
         *
         * @type {Array.<Object>}
         */
        children: [
            {
                /**
                 * 导航名称
                 *
                 * @type {String}
                 */
                title: '出售中的商品',
                name: 'goods/sale',
                component: loaddingComponent('goods/Sale'),
                /**
                 * 路由地址
                 *
                 * @type {String}
                 */
                path: '/goods/sale'
            },
            {
                title: '库存紧张的商品',
                name: 'goods/soldout',
                component: loaddingComponent('goods/Soldout'),
                path: '/goods/soldout'
            },
            {
                title: '仓库中商品',
                name: 'goods/forsale',
                component: loaddingComponent('goods/Forsale'),
                path: '/goods/forsale'
            },
            {
                title: '商品分组',
                name: 'goods/group',
                component: loaddingComponent('goods/Group'),
                path: '/goods/group'
            },
            {
                title: '商品品牌',
                name: 'goods/brand',
                component: loaddingComponent('goods/Brand'),
                path: '/goods/brand'
            },
            {
                title: '发布商品',
                name: 'goods/create',
                component: loaddingComponent('goods/Create'),
                path: '/goods/create',
                noSidebarMenu: true
            }
        ]
    },
    {
        title: '订单管理',
        name: 'order',
        icon: '',
        children: [
            {
                title: '所有订单',
                name: 'order/all',
                component: loaddingComponent('order/All'),
                path: '/order/all'
            },
            {
                title: '待发货订单',
                name: 'order/tosend',
                component: loaddingComponent('order/Tosend'),
                path: '/order/tosend'
            },
            {
                title: '维权订单',
                name: 'order/feedback',
                component: loaddingComponent('order/Feedback'),
                path: '/order/feedback'
            },
            {
                title: '评价管理',
                name: 'order/comment',
                component: loaddingComponent('order/Comment'),
                path: '/order/comment'
            },
            {
                title: '订单设置',
                name: 'order/setting',
                component: loaddingComponent('order/Setting'),
                path: '/order/setting'
            },
            {
                title: '核销记录',
                name: 'order/writeoff',
                component: loaddingComponent('order/Writeoff'),
                path: '/order/writeoff'
            }
        ]
    },
    {
        title: '会员管理',
        name: 'member',
        icon: '',
        children: [
            {
                title: '会员概况',
                name: 'member/survey',
                component: loaddingComponent('member/Survey'),
                path: '/member/survey'
            },
            {
                title: '会员管理',
                name: 'member/management',
                component: loaddingComponent('member/Management'),
                path: '/member/management'
            },
            {
                title: '会员卡管理',
                name: 'member/card',
                component: loaddingComponent('member/MemberCard'),
                path: '/member/card'
            }
        ]
    },
    {
        title: '营销管理',
        name: 'marketing',
        icon: '',
        children: [
            {
                title: '优惠券',
                name: 'marketing/coupon',
                component: loaddingComponent('marketing/Coupon'),
                path: '/marketing/coupon'
            },
            {
                title: '拼团',
                name: 'marketing/fight-groups',
                component: loaddingComponent('marketing/FightGroups'),
                path: '/marketing/fight-groups'
            },
            {
                title: '满减',
                name: 'marketing/full-reduction',
                component: loaddingComponent('marketing/FullReduction'),
                path: '/marketing/full-reduction'
            },
            {
                title: '秒杀',
                name: 'marketing/spike',
                component: loaddingComponent('marketing/Spike'),
                path: '/marketing/spike'
            }
        ]
    },
    {
        title: '资产',
        name: 'asset',
        icon: '',
        children: [
            {
                title: '我的资产',
                name: 'asset/my-asset',
                component: loaddingComponent('asset/MyAsset'),
                path: '/asset/my-asset'
            },
            {
                title: '交易记录',
                name: 'asset/transaction',
                component: loaddingComponent('asset/Transaction'),
                path: '/asset/transaction'
            },
            {
                title: '礼品卡',
                name: 'asset/gift-card',
                component: loaddingComponent('asset/GiftCard'),
                path: '/asset/gift-card'
            }
        ]
    },
    {
        title: '设置',
        name: 'setting',
        icon: '',
        children: [
            {
                title: '店铺信息',
                name: 'setting/info',
                component: loaddingComponent('setting/Info'),
                path: '/setting/info'
            },
            {
                title: '管理员设置',
                name: 'setting/administrator',
                component: loaddingComponent('setting/Administrator'),
                path: '/setting/administrator'
            },
            {
                title: '支付设置',
                name: 'setting/payment',
                component: loaddingComponent('setting/Payment'),
                path: '/setting/payment'
            },
            {
                title: '地区与配送',
                name: 'setting/regional-distribution',
                component: loaddingComponent('setting/RegionalDistribution'),
                path: '/setting/regional-distribution'
            },
            {
                title: '合作伙伴',
                name: 'setting/partner',
                component: loaddingComponent('setting/Partner'),
                path: '/setting/partner'
            }
        ]
    },
    {
        title: '账户设置',
        name: 'account-setting',
        component: loaddingComponent('account/Setting'),
        path: '/account-setting',
        noSidebarMenu: true
    }
]

export default menu
